var/global/libCore/Dev = new()

DBHandler
	createTable(string as text)
		//world.log<<"
		var/list/para = params2list(string)

		var/tblName = para["name"]
		var/list/fields = dd_text2list(para["fields"],"|")
		var/keys = para["keys"]
		var/engine = para["eng"]

		var/sql = {"
		CREATE TABLE IF NOT EXISTS `[tblName]` ("}
		for(var/field in fields)
			var/fname = copytext(field,1,findtext(field," "))
			var/traits = copytext(field,findtext(field," "),0)
			sql += "`[fname]` [traits],"
		sql += "PRIMARY KEY ([keys])"
		sql += ") ENGINE [engine];"

		var/Query/Q = NewQuery(sql)
		world.log<<"SQL = [sql]"
		if(!Q.Execute()) world.log<<"DB ERROR: [Q.ErrorMsg()]"

	proc
		browseQuery(sql as text, target=usr)